package com.ddone.demo.controller;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * @author ddone
 * @date 2024/3/21-23:40
 * @RequestMapping 添加到类上，提取方法上的通用路径！
 */
@Slf4j
@Controller
@RequestMapping("/user")
public class UserController {

    // user/login
    // @RequestMapping(value = {"/login","login1"},method = RequestMethod.POST)
    @PostMapping("/login")
    public String login() {
        log.warn("UerController.login");
        return "login";
    }


    @RequestMapping("register")
    // user/register
    public String register() {
        log.warn("RestUserController.register");
        return "login";
    }

    @RequestMapping("/logout")
    // user/logout
    public String logout() {
        log.warn("RestUserController.logout");
        return "login";
    }

    // user/save
    @RequestMapping("/save")
    public String save() {
        log.warn("RestUserController.save");
        return "login";
    }
}
